1. Field of the Invention
The present invention relates to a transcoder for converting an input stream by decoding into a different output stream, and more particularly to a technique to appropriately control the amount of generated codes of the output stream toward a target bit rate.
2. Description of the Background Art
Images to be delivered on digital broadcasts, those to be stored in media such as DVDs and hard disks, and the like are compressed in accordance with various coding systems. The object for such compressions is to avoid constraint on a transmission band, increase the transmission speed, decrease the memory size or the like.
There are various standards for image coding system, such as MPEG2 and H.264. And there is a case where the coding system is converted for the purpose of reducing the amount of codes in a coded image that is inputted, or the like. A transcoder once decodes the inputted coded image. Then, the transcoder codes the decoded image in a different coding system (or the same coding system) again. Thus, the transcoder controls a bit rate of an output stream.
Japanese Patent Application Laid Open Gazette No. 2006-74635 relates to a transcoder for converting an image compressed in a first compressive coding system into an image compressed in a second compressive coding system. This transcoder uses intermediate information generated during the decoding of the image compressed in the first compressive coding system to compress the image in the second compressive coding system.
In the background-art technique for bit rate conversion, the bit rate conversion is performed on the basis of the bit rate in a unit of GOP (Group Of Pictures) of the input stream and the target bit rate in a unit of GOP of the output stream. Namely, a unit of GOP is set as a control unit time of a rate control. This is based on the premise that the picture structure in the GOPs of the input stream is constant to some degree in the whole sequence, and it is not assumed that the bit rate varies sharply on a GOP basis in the input stream.
For this reason, if the number of frames constituting a GOP becomes smaller temporarily at some midpoint in the sequence or if GOPs have a picture structure in which P picture frames or I picture frames are serially inserted, the ratio of the inserted I picture frames in a control unit time becomes high.
In MPEG2, generally, the bit ratio of I, P and B picture frames is I:P:B=5:3:1. Therefore, if the ratio of the inserted I picture frames or P picture frames temporarily becomes high, the bit rate in the control unit time temporarily rises sharply to be higher than the average bit rate of the input stream and the control on rate conversion becomes unstable, disadvantageously.